import React, { Component } from 'react';

// 模块化开发
// 组件化开发
// ES6的接口暴露方式以及引入方式
export default class Weahter extends Component {
	state = {
		isHot: false,
	};

	changeWeather = () => {
		this.setState({
			isHot: !this.state.isHot,
		});
	};

	render() {
		console.log(this.props);
		return (
			<div>
				<h1>今天天气很{this.state.isHot ? '炎热' : '凉快'}</h1>
				<button onClick={this.changeWeather}>天气变化</button>
			</div>
		);
	}
}
